//
//  IMIDataXML.m
//  IMIData
//
//  Created by Travis on 09-8-17.
//  Copyright 2009 Exmart. All rights reserved.
//

#import "IMIData/IMIDataXML.h"


@implementation IMIDataXML

-(id) initWithURL:(NSURL*)url{
	self = [super init];
	if (self != nil) {
		parser=[[NSXMLParser alloc] initWithContentsOfURL:url];
		[parser setDelegate:self];
	}
	return self;
}

-(id) initWithString:(NSString*)xmlstring{
	self = [super init];
	if (self != nil) {
		parser=[[NSXMLParser alloc] initWithData:[xmlstring dataUsingEncoding:NSStringEncodingConversionAllowLossy]];
		[parser setDelegate:self];
	}
	return self;
}

- (id) init
{
	self = [super init];
	if (self != nil) {
		
	}
	return self;
}
- (void) dealloc
{
	[parser release];
	[data release];
	[super dealloc];
}

#pragma mark Public
-(void) load{
	data=[[NSMutableDictionary alloc] init];
	[parser parse];
}


#pragma mark parser delegate
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict {
	
	
	
}

- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {
	
}


- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
	
	
	
}
@end
